//
//  TestViewController.m
//  MVCTest
//
//  Created by 王冲 on 2018/9/29.
//  Copyright © 2018年 JK科技有限公司. All rights reserved.
//

#import "TestViewController.h"
#import "JKTestView.h"
#import "JKTestModel.h"
@interface TestViewController ()

@end

@implementation TestViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    /**
       优点：对Controller进行瘦身，将View内部的细节封装起来了，外界不知道View内部的具体实现
       缺点：View依赖于Model
    */
    self.title = @"变种的MVC";
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    JKTestView *jkTestView = [[JKTestView alloc]initWithFrame:CGRectMake(50, 200, [UIScreen mainScreen].bounds.size.width-100, 100)];
    jkTestView.backgroundColor = [UIColor brownColor];
    [self.view addSubview:jkTestView];
    
    JKTestModel *model = [JKTestModel new];
    model.name = @"变种的MVC";
    
    jkTestView.model = model;
    
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
